/**
 * 문자열 검사에 대한 검사식을 제공한다.
 */
luffy.common.StringValidators = {
	blank : {
		name : "blank",
		validate : function(sValue){
			return sValue.length != 0;
		}
	},
	
	url : {
		name : "url",
		validate : function(sValue){
			var regUrl = /^http:\/\/.+/;
			return regUrl.test(sValue);
		}
		
	},
	
	dateform : {
		name : "dateform",
		validate : function(sValue){
			var regDate = /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/; 
			return regDate.test(sValue.trim());
		}
	},
	datetime : {
		name : "datetime",
		validate : function(sValue){
			var regDate = /([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})/;			
			if(regDate.test(sValue.trim())){
				var aMinMax = [[],[0,3000],[1,12],[1,31],[0,23],[0,59],[0,59]];
				var aMatch = regDate.exec(sValue.trim());
				for(var i = 1 ; i < aMinMax.length; i++){
					var num = aMatch[i]*1;
					if(aMinMax[i][0] > num || aMinMax[i][1] < num){
						return false;
					}
				}
				return true;								
			}
			return false;
		}
	},
	
	yesOrNo : {
		name : "yes_or_no",
		validate : function(sValue){			 
			return sValue && (sValue.toUpperCase() == "Y" || sValue.toUpperCase() == "N");
		}		
	}
}